package cn.schoolwow.quickdao.test.module.business.user.log.testcase;

import cn.schoolwow.quickdao.domain.DAO;
import cn.schoolwow.quickdao.test.module.business.user.dml.json.testcase.AddUserJSONTestCaseFlow;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import org.apache.commons.lang3.Validate;

public class RecordTestCaseFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        DAO dao = flowContext.checkInstanceData(DAO.class);

        dao.startRecord();
        flowContext.startFlow(new AddUserJSONTestCaseFlow())
                .execute();
        String sql = dao.stopRecord();
        Validate.notEmpty(sql);
        System.out.println(sql);
    }

    @Override
    public String name() {
        return "sql日志记录方法测试用例";
    }
}
